﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PClusterModel.Infrastructure
{
    public class MicroarrayDataMatrix
    {
        private List<IMicroarrayDataObject> microarrayDataObjects;
        private int numberOfRows;
        private int numberOfColumns;

        public MicroarrayDataMatrix()
        {
            this.microarrayDataObjects = new List<IMicroarrayDataObject>();
        }

        public List<IMicroarrayDataObject> MicroarrayDataObjects
        {
            get { return this.microarrayDataObjects; }
        }

        public int NumberOfDataObjects
        {
            get
            {
                if (this.numberOfRows == 0)
                {
                    this.numberOfRows = this.microarrayDataObjects.Count;
                }
                return this.numberOfRows;
            }
        }

        public int NumberOfConditions
        {
            get
            {
                if (this.numberOfColumns == 0)
                {
                    if (this.numberOfRows > 0)
                    {
                        this.numberOfColumns = this.microarrayDataObjects[0].ExpresionValues.Count;
                    }
                }
                return this.numberOfColumns;
            }
        }
    }
}
